﻿using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Inscriptionem.Areas.Inscriptionem.Models.Views
{
    public class UploadCollectionViewModel
    {
        public IEnumerable<FileInfo> Files { get; protected set; }

        public UploadCollectionViewModel(string directory)
        {
            var files = new List<FileInfo>();

            if (Directory.Exists(directory))
            {
                files.AddRange(Directory.GetFiles(directory, "*", SearchOption.TopDirectoryOnly).Select(f => new FileInfo(f)));
            }

            Files = files;
        }

        public int Page { get; set; }
    }
}